#pragma once
#include <assert.h>

template<typename _Tp> class Vec3
{
public:
	Vec3() = default;

	Vec3(_Tp a, _Tp b = 0, _Tp c = 0)
	{
		value[0] = a;
		value[1] = b;
		value[2] = c;
	}

	const _Tp& operator [](int i) const
	{
		assert((unsigned)i < 3);
		return this->value[i];
	}

	_Tp& operator [](int i)
	{
		assert((unsigned)i < 3);
		return this->value[i];
	}

	_Tp value[3];
};

typedef Vec3<int> Vec3i;
typedef Vec3<float> Vec3f;
typedef Vec3<double> Vec3d;
